package cn.com.cabinet.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.cabinet.web.entity.Seller;

public interface SellerDao extends JpaRepository<Seller, Long>,JpaSpecificationExecutor<Seller>{

	@Query("select s from Seller s where s.sICard = ?1")
	public Seller getSellerByICode(String sICard);
	
	@Query("select s from Seller s where s.sPhone = ?1 and (s.sMark = 0 or s.sMark = 1)")
	public Seller getSellerBysPhone(String sPhone);
	
	@Query("select s from Seller s where s.sAccount = ?1 and s.sPwd= ?2 and s.sMark = 1")
	public Seller getSellerBysAccountAndsPwd(String sAccount,String sPwd);
	
	@Query("select s from Seller s where s.sAccount = ?1 and s.sMark = 1")
	public Seller getSellerBysAccount(String sAccount);
}
